package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_BranchCompany 分公司
 *
 */
public class TestData_TB_BranchCompany
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_BranchCompany saveMust(
		org.springframework.context.ApplicationContext context
		
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_BranchCompany");
		return (TB_BranchCompany)repository.save(newMust(
				
			));
	}
	
	public static TB_BranchCompany newMust(
		
	){
		return new TB_BranchCompany(new TB_BranchCompany.MustProperties() {
			/** 代码 */
			@Override public String getNumber(){
				return Generator.generate(0, 32);
			}
			/** 名称 */
			@Override public String getName(){
				return Generator.generate(0, 255);
			}
			/** 电话 */
			@Override public String getPhone(){
				return Generator.generate(0, 20);
			}
			/** 状态 */
			@Override public com.sh_lianjing.model.status.State_UpDown getState(){
				return com.sh_lianjing.model.status.State_UpDown.Downed;
			}
			/** 总金额 */
			@Override public Double getMoney(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
			/** 可提现总金额 */
			@Override public Double getWithdrawMoney(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_BranchCompany saveAll(
		org.springframework.context.ApplicationContext context
		
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_BranchCompany");
		return (TB_BranchCompany)repository.save(newAll(
				
			));
	}
	
	public static TB_BranchCompany newAll(
		
	){
		return new TB_BranchCompany(
			new TB_BranchCompany.MustProperties() {
				/** 代码 */
				@Override public String getNumber(){
					return Generator.generate(0, 32);
				}
				/** 名称 */
				@Override public String getName(){
					return Generator.generate(0, 255);
				}
				/** 电话 */
				@Override public String getPhone(){
					return Generator.generate(0, 20);
				}
				/** 状态 */
				@Override public com.sh_lianjing.model.status.State_UpDown getState(){
					return com.sh_lianjing.model.status.State_UpDown.Downed;
				}
				/** 总金额 */
				@Override public Double getMoney(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
				/** 可提现总金额 */
				@Override public Double getWithdrawMoney(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
			},
			new TB_BranchCompany.OptionalSingleProperties() {
				/** 备注 */
				@Override public String getComment(){
					return Generator.generate(0, 255);
				}
			}
		);
	}
	

}
